package io.renren.modules.work.service.impl;

import org.apache.commons.lang.StringUtils;
import org.springframework.stereotype.Service;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import io.renren.common.utils.PageUtils;
import io.renren.common.utils.Query;

import io.renren.modules.work.dao.ScPurdtlDao;
import io.renren.modules.work.entity.ScPurdtlEntity;
import io.renren.modules.work.service.ScPurdtlService;


@Service("scPurdtlService")
public class ScPurdtlServiceImpl extends ServiceImpl<ScPurdtlDao, ScPurdtlEntity> implements ScPurdtlService {

    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        QueryWrapper<ScPurdtlEntity> scPurdtlEntityQueryWrapper = new QueryWrapper<>();
        if(StringUtils.isNotBlank((String) params.get("purid"))){
            scPurdtlEntityQueryWrapper.eq("purid",params.get("purid"));
        }
        IPage<ScPurdtlEntity> page = this.page(
                new Query<ScPurdtlEntity>().getPage(params),
                scPurdtlEntityQueryWrapper
        );

        return new PageUtils(page);
    }

}